import { createRouter, createWebHistory } from 'vue-router';
import Home from '../components/Home.vue';
import RestaurantDetails from '../components/RestaurantDetails.vue';
import UserInfo from '../components/UserInfo.vue';

const routes = [
    {
        path: '/',
        name: 'Home',
        component: Home
    },

    {
        path: '/restaurant',
        name: 'restaurant',
        component: RestaurantDetails,
        props: true
    },

    {
        path: '/user',
        name: 'user',
        component: UserInfo
    },
    // {
    //     path: '/restaurant/:id',
    //     name: 'RestaurantDetails',
    //     component: RestaurantDetails,
    //     props: true
    // },
];

const router = createRouter({
    history: createWebHistory(import.meta.env.BASE_URL), // 移除 process.env.BASE_URL
    routes,
});

export default router;